package main

import "fmt"

func main() {
	ch := make(chan string)
	go sendData(ch)
	getData(ch)
}

func getData(ch chan string) {
	for true {
		data, open := <- ch
		if !open {
			break
		}
		fmt.Println("getData is :", data)
	}
}

func sendData(ch chan string) {
	for i := 0; i < 20; i++ {
		ch <- fmt.Sprintf("Hello_%d", i)
	}
	close(ch)
}
